package com.group3.controller.teacherController;

import com.group3.domain.StudentInfoByLesson;
import com.group3.pojo.receive.TLessonListReceive;
import com.group3.pojo.receive.TStudentListReceive;
import com.group3.pojo.result.LessonResult;
import com.group3.service.TeacherLessonService;
import com.group3.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * LessonController - 项目课程表界面
 *
 * @author MHH,PX,HY
 * 2021/06/03 15:28
 **/
@Api(tags = "教师接口")
@RestController
@RequestMapping("/teacher/lesson")
public class TeacherLessonController {
    @Resource
    TeacherLessonService teacherLessonService;

    // 查询项目课程表
    @ApiOperation(value = "查询项目课程表")
    @GetMapping("")
    public Result<List<LessonResult>> selectLesson(TLessonListReceive lessonListReceive) {
        return teacherLessonService.selectLessonList(lessonListReceive);
    }

    // 根据课程id查询学生 - 在项目课程表页面的“查看学生”按钮，查询该课程下的所有学生
    @ApiOperation(value = "查看课程下学生")
    @GetMapping("/student")
    public Result<List<StudentInfoByLesson>> selectStudentByLesson(TStudentListReceive tStudentListReceive) {
        return teacherLessonService.selectStudentByLesson(tStudentListReceive);
    }
}



